package test

import java.util.*

/**
 *
 *  public static <T> Comparator<T> shuffle() {
        final Map<Object, UUID> uniqueIds = new IdentityHashMap<>();
        return Comparator.comparing(e -> uniqueIds.computeIfAbsent(e, k -> UUID.randomUUID()));
    }
 * */

/*
fun <T> shuffle(): Comparator<T> {
    val uniqueIds = IdentityHashMap<T, UUID>()
    return Comparator.comparing<T, UUID> { e -> (uniqueIds as java.util.Map<T, UUID>).computeIfAbsent(e) {
        UUID.randomUUID() }
    }
}

fun main(){
    val list = listOf(1,2,3,4,5,6,7,8,9,10)

    print(list.sortedWith(shuffle()))

    val a :Int = 5;
    println(a.toLong())
}*/
